/* -----------------------------------------------------------------------
 *
 * Include the following lines in your makefile:
 *
 * testunittest3: unittest3.c dominion.o rngs.o
 *      gcc -o testunittest3 -g  unittest3.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */
#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

int main () {

  int r;
  int count;  //num of cards in hand
  int k[10] = {adventurer, council_room, feast, gardens, mine,
               remodel, smithy, village, baron, great_hall};

  struct gameState G;
  int seed = 1000;
  int p;
  int numPlayer = 2;

    printf ("Testing numCards(): \n");
     memset(&G, 23, sizeof(struct gameState));
    r = initializeGame(numPlayer, k, seed, &G);



  count  = numHandCards( &G);
#if (NOISY_TEST == 1)
     printf("Number of cards in hand  should be 5 \n");
#endif

 assert(count == 5);
#if (NOISY_TEST == 1)
     printf("Number of cards in hand is:  %d\n",  count);
#endif

int player = whoseTurn(&G);

int draw_card = drawCard(player, &G);
count  = numHandCards( &G);

#if (NOISY_TEST == 1)
    printf("Number of cards after drawing a card should be 6\n");
#endif

assert(count == 6);
#if (NOISY_TEST == 1)
    printf("Number of cards after player  drew a card is: %d\n", count);
#endif

draw_card = drawCard(player, &G);
count = numHandCards(&G);
#if (NOISY_TEST == 1)
    printf("Number of cards after drawing another card should be 7\n");
#endif

assert(count == 7);
#if (NOISY_TEST == 1)
    printf("Number of cards after player drawing a card is: %d\n", count);
#endif

printf("All tests passed!\n");





  return 0;
}
